<?php

namespace App\Http\Middleware;

use App\Models\Common;
use Closure;
use Illuminate\Http\Request;

class ApiGuestMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        if($request->api_user){
            Common::resJson([
                'code'=> 10022,
                'msg' => '用户已登录',
                'data' => ''
            ]);
        }else{
            return $next($request);
        }
    }
}
